//	AUTHOR:			ENRICO CANTONI
//	CREATED:		MARCH 17, 2017
//	MODIFIED: 		JUNE 28, 2017
//	DESCRIPTION:	Format strings removing leading, intermediate blank spaces
//					and replacing to upper chars.

********************************************************************************
********************************************************************************

capture drop program uppertrim
program define uppertrim, nclass
	syntax varlist

	// Replace vars to all upper chars w/o blank spaces
	foreach v of varlist `varlist' {
		cap confirm string var `v'
		if !_rc {
			di in green "Removing excess chars from var `v'"
			replace `v' = ustrupper(ustrtrim(itrim(`v')))
		}
	}
end
	
